package com.itheima.dao;

import com.github.pagehelper.Page;
import com.itheima.pojo.Permission;

import java.util.List;
import java.util.Set;

/**
 * 权限数据接口
 */
public interface PermissionDao {

    //根据角色id查询权限列表
    Set<Permission> findPermissionsByRoleId(Integer roleId) throws Exception;
    //增删改查
    int insertSelective(Permission record) throws Exception;
    int deleteByPrimaryKey(Integer id) throws Exception;
    int updateByPrimaryKeySelective(Permission record) throws Exception;
    //回显数据
    Permission selectByPrimaryKey(Integer id) throws Exception;
    //分页
    Page<Permission> selectByCondition(String queryString) throws Exception;
    //校验
    int checkPermissionExist(String name) throws Exception;
    //查看是否被引用为外键
    int findCountByPermissionId(int id);

    //返回所有数据,用于新增role展示
    List<Permission> findAll();
}
